home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _SQLite_QueryReset.au3 < prev    next >
Text File  |  2007-09-08  |  792b  |  23 lines

  1. #include <SQLite.au3>
  2. #include <SQLite.dll.au3>
  3.  
  4. Local $hQuery, $aRow, $iSwitch
  5. _SQLite_Startup()
  6. _SQLite_Open()
  7. _SQLite_Exec(-1,"CREATE TABLE tblTest (a,b,c);")
  8. _SQLite_Exec(-1,"INSERT INTO tblTest VALUES ('1','1','1');" & _ ; Row 1
  9.                 "INSERT INTO tblTest VALUES ('2','2','2');" & _ ; Row 2
  10.                 "INSERT INTO tblTest VALUES ('3','3','3');")    ; Row 3
  11. _SQLite_Query(-1,"SELECT RowID,* FROM tblTest;",$hQuery)
  12. While _SQLite_FetchData($hQuery,$aRow) = $SQLITE_OK 
  13.     $iSwitch = MsgBox(4+64, "Row: " & $aRow[0], $aRow[1] & "," & $aRow[2] & "," & $aRow[3] & @LF & _
  14.                             "Continue Looping?")
  15.     If $iSwitch = 6 Then ; Yes
  16.         If $aRow[0] = 3 Then _SQLite_QueryReset($hQuery)
  17.     Else ; No
  18.         _SQLite_QueryFinalize($hQuery)
  19.         ExitLoop
  20.     EndIf
  21. WEnd
  22. _SQLite_Close()
  23. _SQLite_Shutdown()